<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <title>login</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>

    <link rel="stylesheet" href="/Public/AmazeUI-2.4.2/assets/css/amazeui.min.css"/>
    <link href="/Public/css1/dlstyle.css" rel="stylesheet" type="text/css">
    <script src="/Public/AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
    <script src="/Public/AmazeUI-2.4.2/assets/js/amazeui.min.js"></script>
    <script src="/Public/js/layer/layer.js"></script>

</head>

<body>

<div class="login-boxtitle">
    <a href="<?php echo U('Home/Index/index');?>"><img alt="" src="/Public/images1/logoNew.png"/></a>
</div>

<div class="res-banner">
    <div class="res-main" style="margin:0 auto;">
        <div class="login-box" style="background: url('/Public/images1/bg-middle.png') 1262px 0px; ">
            <div class="box" style="margin-top: 140px;position: relative;">
                <a href="<?php echo U('Home/User/login');?>" style="display: block;position:absolute;z-index:999;right:0px;color: #08c;font-size: 20px;font-family: Candara;">Sign in</a>
                <form method="post" onsubmit="return check_submit(this)">

                    <div class="user-email" style="margin-bottom: 10px;">
                        <label for="email" style="height: 30px;">Account&nbsp;:</label>
                        <input type="email" name="username" id="username" placeholder="Email address or member ID">
                    </div>
                    <div class="user-email" style="margin-bottom: 0px;">
                        <input type="text" name="code" id="code" placeholder="Please enter the verification code" style="display: inline-block;width: 78%">
                        <button type="button" style="border:none;height: 36px;background: #08c;color: #FFF;width: 105px;font-size: 20px;font-family: Candara;" onclick="send_smtp_reg_code()">Get Code</button>
                    </div>
                    <div class="user-pass" style="margin-bottom: 0px;">
                        <label for="password" style="height: 30px;">Password&nbsp;:</label>
                        <input type="password" name="password" id="password3" placeholder="Set password">
                    </div>
                    <div class="user-pass">
                        <label for="passwordRepeat" style="height: 30px;">Again&nbsp;Password&nbsp;:</label>
                        <input type="password" name="password2" id="password4" placeholder="Confirm password">
                    </div>
                    <div class="am-cf">
                        <input type="submit" name="" value="Register" class="am-btn am-btn-primary am-btn-sm am-fl" style="background: #2b7ce5;height: 36px;line-height: 10px;font-size: 20px;font-family: Candara;">
                    </div>
                </form>



                <script>
                    $(function () {
                        $('#doc-my-tabs').tabs();
                    })
                </script>
            </div>


        </div>
    </div>

    <div class="footer " style="text-align: center" >
        <div class="footer-bd " style="color: #999;" >
            <p>China Contact: Ms.Sophia Gan EMAIL:sophia@sensilintl.com Tel: 0086 15880683346
                USA Contact: Mr.Brian Williams EMAIL:brain@sensilintl.com
                Tel:001 702 308 4860 M: 001 660537 2111 /001 619 5724642</p>
            <p>© 2017-2018 Sensil International INC.</p>
        </div>
    </div>
</div>

<script type="text/javascript">

    function send_smtp_reg_code(){
        var email = $('#username').val();
        if(!checkEmail(email)){
            layer.alert('Please enter the correct mailbox', {icon: 2});// alert('请输入正确的手机号码');
            return;
        }
        $.ajax({
            type : "POST",
            url:"<?php echo U('Home/User/send_validate_code');?>",
            data : {type:'email',send:email},// 你的formid
            dataType: "json",
            success: function(data){
                console.info(data);
                if(data.status){
                    $('#count_down').attr("disabled","disabled");
                    /*   intAs = <?php echo ($sms_time_out); ?>; // 发送邮箱
                     jsInnerTimeout('count_down',intAs);*/
                }
                layer.alert(data.msg, {icon: 1});// alert(obj.msg);
            },
            error:function(data){

                console.info(data);
            }
        });

    }
    function check_submit(obj){

        var username = $(obj).find('input[name="username"]').val();
        var password = $(obj).find('input[name="password"]').val();
        var password2 = $(obj).find('input[name="password2"]').val();
        var error = '';
        if(username == ''){
            error += 'User Name cannot be empty';
        }
        if(password == '' || password2 == ''){
            error += 'Password cannot be empty\n';
        }

        if(password !== password2){
            error += 'Two input passwords are inconsistent\n';
        }
        if(password.length < 6){
            error += 'Password length should not be less than six\n';
        }
        if(error){
//            layer.alert(error, {icon: 2});
            alert(error);
            // alert(error);
            return false;
        }
        return true;
    }


    function checkEmail(str){
        var reg = /^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
        if(reg.test(str)){
            return true;
        }else{
            return false;
        }
    }

    function showErrorMsg(msg){

        layer.open({content:msg,time:2});
    }
</script>

</body>

</html>